package baidu.gifcanvas;

import java.awt.BorderLayout;
import java.awt.Canvas;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.JFrame;

public class GifFrame extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Canvas canvas;
//	private JButton button;
//	private Image image;
	public GifFrame() {
		
		setSize(500,400);
		setLayout(new BorderLayout());
		
		canvas = new GifCanvas();
		
//		canvas.getGraphics().drawImage(image, 10, 10, null);
		canvas.addMouseListener(new MouseAdapter() {

			/* (non-Javadoc)
			 * @see java.awt.event.MouseAdapter#mouseClicked(java.awt.event.MouseEvent)
			 */
			@Override
			public void mouseClicked(MouseEvent e) {
				// TODO Auto-generated method stub
				System.out.println("efreg");
				canvas.repaint();
			}
			
		});
		add(canvas, BorderLayout.CENTER);
		
		setVisible(true);
		
	}
	public static void main(String[] args) {
		new GifFrame();
	}
}
